package cn.shutdown.service.impl;

import cn.shutdown.dao.IResourceDao;
import cn.shutdown.po.ResourceEntity;
import cn.shutdown.service.IResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("resourceService")
public class ResourceServiceImpl implements IResourceService {

    @Autowired
    private IResourceDao resourceDao;

    public List<ResourceEntity> findAll() {
        return resourceDao.selectAll();
    }

    @Override
    public ResourceEntity findById(int id) {
        return resourceDao.selectByPrimaryKey(id);
    }

    @Override
    public void save(ResourceEntity resourceEntity) {
        resourceDao.insert(resourceEntity);
    }
}
